#include "struct_sub.h"

typedef struct entry{
	/*File-Info*/
	char *name;
	char *file_name;
	int size;
	format_e format;
	/*Meta-Info*/
	long bit_rate;
	long duration;  /*micro-second*/
	int channels;
	int channel_layout;
	int sample_rate;
	sample_format_e sample_format;
	/*Meta-Info*/
	char *title;
	char *artist;
	char *album;
	/*PCM-Buffer*/
	void *music_buf;
	unsigned int music_buf_size;
	void *music_buf_end;

}entry_s; 

typedef struct list{
	char *dir_name;
	char *list_name;
	unsigned int cur_entry;
	struct entry **entry_array;
	unsigned int total_entries_number;
	unsigned int *sequence;	/*顺序控制块*/ 
}list_s; 

typedef struct switches{
	bool show_on;

}switches_s;

typedef enum control{
	GONE = 0,
	START,
	PAUSE,
	STOP,
	VOLUME,
	SEEK
}control_e;

typedef enum status_mask{ 
	/*Driver-Status*/				
	AVOID_POST_PROCESSING = 1<<0,	/*当状态不实时的时候。需要避开后期处理*/
	PLAYING = 1<<1,
	STOPPED = 1<<2,
	PAUSED = 1<<3,
	EOS = 1<<4,
	ERROR = 1<<5,
	/*List-Status*/		/*需要调用list_clear_status接口来手动清除标志位*/
	ADDING = 1<<8,		/*添加文件或列表时为1*/
	DELING = 1<<9,		/*删除文件或列表时为1*/
	COMPLETED = 1<<10	/*以上动作在执行期间此值为0，完成后始终为1*/
	
}status_mask_e;

typedef struct status{		
	/*Status*/
	int flags;
	/*Driver-Status*/
	entry_s *now_playing;
	int volume;	
	bool mute_on;
	int position;
	/*List-Status*/
	entry_s *now_adding;
	entry_s *now_deling;
	
}status_s;




